//
//  LRXNavigationController.m
//  路人侠
//
//  Created by zhangxulong on 2/7/16.
//  Copyright © 2016 zhangxulong. All rights reserved.
//

#import "LRXNavigationController.h"

@implementation LRXNavigationController

+ (void)initialize
{
    UINavigationBar * navigationBar = [UINavigationBar appearance];
    
    
    //隐藏 导航栏下面的线 隐藏
    [navigationBar setBackgroundImage:[UIImage imageNamed:@"Nar"]
                       forBarPosition:UIBarPositionAny
                           barMetrics:UIBarMetricsDefault];
    [navigationBar setShadowImage:[UIImage new]];
    
    
    //1、设置导航栏的背景颜色
    [navigationBar setBarTintColor:mainColor];

    
    
    //    UIApplication 设置状态栏的样式  －－设置全局
    [UIApplication sharedApplication].statusBarStyle= UIStatusBarStyleLightContent;
    
    //    设置导航条标题字体和颜色
    NSDictionary * barDic = @{
                              NSForegroundColorAttributeName:[UIColor colorWithRed:253.0 / 255 green:253.0 /255 blue:253.0 / 255 alpha:1],
                              NSFontAttributeName:[UIFont systemFontOfSize:35 * hScale]
                              };
    [navigationBar setTitleTextAttributes:barDic];
    
    //改变的整个 按钮背景  tintColor 是用于导航条所有item
    navigationBar.tintColor = [UIColor whiteColor];
    
    
    //设置返回按钮的样式
    UIBarButtonItem * navigationItem = [UIBarButtonItem appearance];
    [navigationItem setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:35 * hScale]} forState:UIControlStateNormal];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    //左滑动的手势 的 效果
//    __weak typeof (self) weakSelf = self;
//    if ([self respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
//        self.interactivePopGestureRecognizer.delegate = weakSelf;
//    }
}

@end
